package cn.nbt.busManage.model.dto;

import cn.nbt.busManage.model.entity.Menu;
import cn.nbt.busManage.model.vo.MenuVo;
import jakarta.persistence.Column;
import lombok.Data;

import java.util.List;

@Data
public class MenuDto {
    private Integer id;
    private String name;
    private Integer pid;
    private String url;
    private List<MenuDto> menuDtos;

    public MenuDto(Menu menu){
        this.pid = menu.getPid();
        this.id = menu.getId();
        this.url = menu.getUrl();
        this.name = menu.getName();
    }

    public MenuDto(MenuVo menuVo){
        this.name = menuVo.getName();
        this.id = menuVo.getId();
        this.url = menuVo.getUrl();
        this.pid = menuVo.getPid();
    }
}
